package com.wjggy.core.service.posts.Impl;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.wjggy.core.action.view.PostsView;
import com.wjggy.core.common.dbtools.DaoUtils;
import com.wjggy.core.common.page.Page;
import com.wjggy.core.common.page.PageUtil;
import com.wjggy.core.common.springview.ViewUtil;
import com.wjggy.core.entities.Forums;
import com.wjggy.core.service.posts.ForumService;


 /**
 *  <p>Description:  </p>
 *  <p>Copyright:Copyright (c) 2012  </p>
 *  <p>Company:wjggy  </p>
 *  @author xiaofan.yu  
 *  @date   2012-2-3 下午05:53:12    
 *  @project  wjggy
 *  @version  1.0.0
 *  @see   
 *  @since 1.6 
 */
@Service("forumService")
public class ForumServiceImpl implements ForumService{
	private static final Logger log = Logger.getLogger(PostsServiceImpl.class);
	@Resource(name="daoUtils")
	private DaoUtils daoUtils;
	@Override
	public List<Forums> findForums(Forums forums,Page page) {
		return daoUtils.findRows("forums.queryAll", forums,page);
	}

	@Override
	public List<Forums> findForums(Forums forums) {
		return  daoUtils.findAll("forums.queryAll", forums);
	}

	@Override
	public boolean addForums(Forums forums) {
		daoUtils.add("forums.insert", forums);
		return true;
	}

	@Override
	public boolean deleteForums(Forums forums) {
		 daoUtils.delete("forums.delete", forums);
		return true;
	}

	@Override
	public boolean updateForums(Forums forums) {
		 daoUtils.update("forums.update", forums);
		return false;
	}
	@Override
	public Forums getForums(Long id){
		return (Forums) daoUtils.findObject("forums.queryByID", id);
	}
}

